package com.qianli.cashmama.trade.client.trade.response;

import com.qianli.cashmama.trade.client.vo.TradeStatusHistoryVO;
import com.qianli.cashmama.trade.common.enums.*;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: sm
 * Date: 2017/7/24
 * Time: 上午12:04
 */
public class TradeInfoResponse implements Serializable {

    private static final long serialVersionUID = 4610850661461004314L;
    /**
     * 交易编码
     */
    private String tradeNo;
    private String merchantCode;
    /**
     * 客户code
     */
    private String customerCode;
    /**
     * 用户code
     */
    private String userCode;
    /**
     * 渠道code
     */
    private String channelCode;
    /**
     * 产品code
     */
    private String productCode;

    /**
     * 产品类目
     */
    private String productCategory;

    /**
     * 客户端类型
     */
    private TradeClientTypeEnum clientType;
    /**
     * 订单状态
     */
    private TradeStatusEnum orderStatus;
    /**
     * 信审状态
     */
    private TradeAuditStatusEnum auditStatus;
    /**
     * 信审子状态
     */
    private TradeAuditSubStatusEnum auditSubStatus;
    /**
     * 订单类型
     */
    private TradeTypeEnum orderType;
    /**
     * 支付状态
     */
    private TradePayStatusEnum payStatus;
    /**
     * 借款总金额
     */
    private String borrowTotalCapital;
    /**
     * 到账总金额
     */
    private String receivedTotalCapital;
    /**
     * 应还总金额
     */
    private String repaymentTotalCapital;
    /**
     * 已还总金额
     */
    private String paidTotalCapital;
    /**
     * 优惠总金额
     */
    private String discountTotalCapital;
    /**
     * 总服务费(QSYQ是按照产品配置的，固定服务费；个税贷服务费=总本金*月服务费率*借款期数)
     */
    private String totalServiceFee;
    /**
     * 借款利率
     */
    private String borrowRatio;
    /**
     * 总期数
     */
    private Integer totalPeriod;
    /**
     * 已还期数
     */
    private Integer paidPeriod;

    /**
     * 周期长度
     */
    private Integer periodLength;
    /**
     * 借款周期
     */
    private Integer borrowDuration;
    /**
     * 总逾期服务费
     */
    private String totalOverdueServiceFee;
    /**
     * 总逾期费
     */
    private String totalOverdueFee;
    /**
     * 单次账单逾期应该缴纳的费用
     */
    private BigDecimal overdueServiceFee;
    /**
     * 逾期利率
     */
    private String overdueRatio;

    /**
     * 申请时间、创建时间
     */
    private Date applyDate;
    /**
     * 审核时间
     */
    private Date auditDate;


    /**
     * 到账时间
     */
    private Date receivedDate;
    /**
     * 还清时间
     */
    private Date payOffDate;
    /**
     * 交易编码
     */
    private String payNo;
    /**
     * 资金方
     */
    private String capitalCode;

    /**
     * 银行卡号码
     */
    private String bankNo;

    /**
     * 关闭类型
     */
    private TradeCloseTypeEnum tradeCloseTypeEnum;

    /**
     * 是否为新客
     */
    private Boolean isNewUser = true;

    /**
     * 借款unit
     */
    private TradeBorrowDurationEnum borrowDurationEnum;

    /**
     * 交易单对应单券ID
     */
    private String userCouponId;

    /**
     * 借款用途枚举
     */
    private UsageOfLoanEnum usageOfLoan;

    /**
     * 当前交易合同地址
     */
    private String contractUrl;
    /**
     * 合同的签署时间
     */
    private Date signDate;

    private String extraData;

    /**
     * 签署合同状态
     */
    private TradeSignStatusEnum tradeSignStatusEnum;

    public String getMerchantCode() {
        return merchantCode;
    }

    public TradeInfoResponse setMerchantCode(String merchantCode) {
        this.merchantCode = merchantCode;
        return this;
    }

    public String getExtraData() {
        return extraData;
    }

    public TradeInfoResponse setExtraData(String extraData) {
        this.extraData = extraData;
        return this;
    }

    public TradeSignStatusEnum getTradeSignStatusEnum() {
        return tradeSignStatusEnum;
    }

    public TradeInfoResponse setTradeSignStatusEnum(TradeSignStatusEnum tradeSignStatusEnum) {
        this.tradeSignStatusEnum = tradeSignStatusEnum;
        return this;
    }

    public String getContractUrl() {
        return contractUrl;
    }

    public TradeInfoResponse setContractUrl(String contractUrl) {
        this.contractUrl = contractUrl;
        return this;
    }

    public Date getSignDate() {
        return signDate;
    }

    public TradeInfoResponse setSignDate(Date signDate) {
        this.signDate = signDate;
        return this;
    }

    public UsageOfLoanEnum getUsageOfLoan() {
        return usageOfLoan;
    }

    public void setUsageOfLoan(UsageOfLoanEnum usageOfLoan) {
        this.usageOfLoan = usageOfLoan;
    }

    public Boolean getNewUser() {
        return isNewUser;
    }

    public TradeInfoResponse setNewUser(Boolean newUser) {
        isNewUser = newUser;
        return this;
    }

    public Integer getPeriodLength() {
        return periodLength;
    }

    public TradeInfoResponse setPeriodLength(Integer periodLength) {
        this.periodLength = periodLength;
        return this;
    }

    /**
     * 交易状态历史
     */


    private List<TradeStatusHistoryVO> statusHistoryList = new ArrayList<>();

    public TradeBorrowDurationEnum getBorrowDurationEnum() {
        return borrowDurationEnum;
    }

    public TradeInfoResponse setBorrowDurationEnum(TradeBorrowDurationEnum borrowDurationEnum) {
        this.borrowDurationEnum = borrowDurationEnum;
        return this;
    }

    public Date getApplyDate() {
        return applyDate;
    }

    public TradeInfoResponse setApplyDate(Date applyDate) {
        this.applyDate = applyDate;
        return this;
    }

    public String getBankNo() {
        return bankNo;
    }

    public TradeInfoResponse setBankNo(String bankNo) {
        this.bankNo = bankNo;
        return this;
    }

    public TradeCloseTypeEnum getTradeCloseTypeEnum() {
        return tradeCloseTypeEnum;
    }

    public TradeInfoResponse setTradeCloseTypeEnum(TradeCloseTypeEnum tradeCloseTypeEnum) {
        this.tradeCloseTypeEnum = tradeCloseTypeEnum;
        return this;
    }

    public List<TradeStatusHistoryVO> getStatusHistoryList() {
        return statusHistoryList;
    }

    public TradeInfoResponse setStatusHistoryList(List<TradeStatusHistoryVO> statusHistoryList) {
        this.statusHistoryList = statusHistoryList;
        return this;
    }

    public String getProductCategory() {
        return productCategory;
    }

    public TradeInfoResponse setProductCategory(String productCategory) {
        this.productCategory = productCategory;
        return this;
    }

    public String getTradeNo() {
        return tradeNo;
    }

    public TradeInfoResponse setTradeNo(String tradeNo) {
        this.tradeNo = tradeNo;
        return this;
    }

    public String getCustomerCode() {
        return customerCode;
    }

    public TradeInfoResponse setCustomerCode(String customerCode) {
        this.customerCode = customerCode;
        return this;
    }

    public String getUserCode() {
        return userCode;
    }

    public TradeInfoResponse setUserCode(String userCode) {
        this.userCode = userCode;
        return this;
    }

    public String getChannelCode() {
        return channelCode;
    }

    public TradeInfoResponse setChannelCode(String channelCode) {
        this.channelCode = channelCode;
        return this;
    }

    public String getProductCode() {
        return productCode;
    }

    public TradeInfoResponse setProductCode(String productCode) {
        this.productCode = productCode;
        return this;
    }


    public TradeClientTypeEnum getClientType() {
        return clientType;
    }

    public TradeInfoResponse setClientType(TradeClientTypeEnum clientType) {
        this.clientType = clientType;
        return this;
    }

    public TradeStatusEnum getOrderStatus() {
        return orderStatus;
    }

    public TradeInfoResponse setOrderStatus(TradeStatusEnum orderStatus) {
        this.orderStatus = orderStatus;
        return this;
    }

    public TradeAuditStatusEnum getAuditStatus() {
        return auditStatus;
    }

    public TradeInfoResponse setAuditStatus(TradeAuditStatusEnum auditStatus) {
        this.auditStatus = auditStatus;
        return this;
    }

    public TradeAuditSubStatusEnum getAuditSubStatus() {
        return auditSubStatus;
    }

    public TradeInfoResponse setAuditSubStatus(TradeAuditSubStatusEnum auditSubStatus) {
        this.auditSubStatus = auditSubStatus;
        return this;
    }

    public TradeTypeEnum getOrderType() {
        return orderType;
    }

    public TradeInfoResponse setOrderType(TradeTypeEnum orderType) {
        this.orderType = orderType;
        return this;
    }

    public TradePayStatusEnum getPayStatus() {
        return payStatus;
    }

    public TradeInfoResponse setPayStatus(TradePayStatusEnum payStatus) {
        this.payStatus = payStatus;
        return this;
    }

    public String getBorrowTotalCapital() {
        return borrowTotalCapital;
    }

    public TradeInfoResponse setBorrowTotalCapital(String borrowTotalCapital) {
        this.borrowTotalCapital = borrowTotalCapital;
        return this;
    }

    public String getReceivedTotalCapital() {
        return receivedTotalCapital;
    }

    public TradeInfoResponse setReceivedTotalCapital(String receivedTotalCapital) {
        this.receivedTotalCapital = receivedTotalCapital;
        return this;
    }

    public String getRepaymentTotalCapital() {
        return repaymentTotalCapital;
    }

    public TradeInfoResponse setRepaymentTotalCapital(String repaymentTotalCapital) {
        this.repaymentTotalCapital = repaymentTotalCapital;
        return this;
    }

    public String getPaidTotalCapital() {
        return paidTotalCapital;
    }

    public TradeInfoResponse setPaidTotalCapital(String paidTotalCapital) {
        this.paidTotalCapital = paidTotalCapital;
        return this;
    }

    public String getDiscountTotalCapital() {
        return discountTotalCapital;
    }

    public TradeInfoResponse setDiscountTotalCapital(String discountTotalCapital) {
        this.discountTotalCapital = discountTotalCapital;
        return this;
    }

    public String getTotalServiceFee() {
        return totalServiceFee;
    }

    public TradeInfoResponse setTotalServiceFee(String totalServiceFee) {
        this.totalServiceFee = totalServiceFee;
        return this;
    }

    public String getBorrowRatio() {
        return borrowRatio;
    }

    public TradeInfoResponse setBorrowRatio(String borrowRatio) {
        this.borrowRatio = borrowRatio;
        return this;
    }

    public Integer getTotalPeriod() {
        return totalPeriod;
    }

    public TradeInfoResponse setTotalPeriod(Integer totalPeriod) {
        this.totalPeriod = totalPeriod;
        return this;
    }

    public Integer getPaidPeriod() {
        return paidPeriod;
    }

    public TradeInfoResponse setPaidPeriod(Integer paidPeriod) {
        this.paidPeriod = paidPeriod;
        return this;
    }

    public Integer getBorrowDuration() {
        return borrowDuration;
    }

    public TradeInfoResponse setBorrowDuration(Integer borrowDuration) {
        this.borrowDuration = borrowDuration;
        return this;
    }

    public String getTotalOverdueServiceFee() {
        return totalOverdueServiceFee;
    }

    public TradeInfoResponse setTotalOverdueServiceFee(String totalOverdueServiceFee) {
        this.totalOverdueServiceFee = totalOverdueServiceFee;
        return this;
    }

    public String getTotalOverdueFee() {
        return totalOverdueFee;
    }

    public TradeInfoResponse setTotalOverdueFee(String totalOverdueFee) {
        this.totalOverdueFee = totalOverdueFee;
        return this;
    }

    public String getOverdueRatio() {
        return overdueRatio;
    }

    public TradeInfoResponse setOverdueRatio(String overdueRatio) {
        this.overdueRatio = overdueRatio;
        return this;
    }

    public Date getReceivedDate() {
        return receivedDate;
    }

    public TradeInfoResponse setReceivedDate(Date receivedDate) {
        this.receivedDate = receivedDate;
        return this;
    }

    public Date getPayOffDate() {
        return payOffDate;
    }

    public TradeInfoResponse setPayOffDate(Date payOffDate) {
        this.payOffDate = payOffDate;
        return this;
    }

    public String getPayNo() {
        return payNo;
    }

    public TradeInfoResponse setPayNo(String payNo) {
        this.payNo = payNo;
        return this;
    }

    public String getCapitalCode() {
        return capitalCode;
    }

    public TradeInfoResponse setCapitalCode(String capitalCode) {
        this.capitalCode = capitalCode;
        return this;
    }

    public boolean paidClear() {
        return payOffDate != null;
    }

    public String getUserCouponId() {
        return userCouponId;
    }

    public TradeInfoResponse setUserCouponId(String userCouponId) {
        this.userCouponId = userCouponId;
        return this;
    }

    public BigDecimal getOverdueServiceFee() {
        return overdueServiceFee;
    }

    public TradeInfoResponse setOverdueServiceFee(BigDecimal overdueServiceFee) {
        this.overdueServiceFee = overdueServiceFee;
        return this;
    }

    public Date getAuditDate() {
        return auditDate;
    }

    public TradeInfoResponse setAuditDate(Date auditDate) {
        this.auditDate = auditDate;
        return this;
    }
}
